fix(deps): update dependency @mastra/core to v1#48
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
7b23759 to
4ca1f39
Compare
c64fbb8 to
c33d6c8
Compare
6ad1902 to
ef06b25
Compare
181489a to
7f2bbe9
Compare
9583e0f to
bf7edb0
Compare
ee1ce1f to
877ff2d
Compare
0eeb3ee to
aad6296
Compare
be8d060 to
3342730
Compare
7283845 to
351503f
Compare
6447382 to
a2ce468
Compare
3e0ca28 to
2121e8f
Compare
90f71f3 to
a7d4d63
Compare
60ada13 to
95f67b1
Compare
95f67b1 to
a41f905
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.12.1→^1.0.0Release Notes
mastra-ai/mastra (@mastra/core)
v1.36.0Compare Source
Minor Changes
Added
activateAfterIdle: "auto"for Observational Memory early activation. (#16663)Mastra can now choose an idle activation timeout from the active model provider's prompt cache behavior. OpenAI also respects
providerOptions.openai.promptCacheRetentionwhen available.Added support for permission arrays in FGA checks and route configuration. When an array is provided, the user needs any one of the listed permissions (logical OR). (#16605)
Affected types
FGACheckParams.permissionFGARouteConfig.permissionFGARouteInfo.requiresPermissionFGADeniedError.permissionCheckFGAOptions.permissionSingle-permission usage continues to work unchanged.
Added consistent FGA execution checks across agents, tools, memory, and workflows to prevent unauthenticated executions when FGA is configured. Pass an authenticated user through
requestContextwhen invoking protected APIs directly: (#16651)Added the
EditorFavorite*types and an optionalfavoritesnamespace onIMastraEditorso editor implementations can expose favoriting of stored agents and skills. (#16749)The
favoritesfield is optional — existing implementations ofIMastraEditorcontinue to work unchanged.@mastra/editorships a defaultEditorFavoritesNamespacethat wires this up against the storagefavoritesdomain.Also renamed
AgentFeatures.starstoAgentFeatures.favoritesin@mastra/core/agent-builder/eeso the feature flag aligns with the storage column (favoriteCount), HTTP routes (/favorite), and the editorfavoritesnamespace. The field had no functional consumers, so this is a name-only change.Enterprise edition now automatically captures PostHog telemetry for EE license checks and feature usage, including license validation status, RBAC access resolution, FGA authorization calls, and EE feature invocation metadata. Telemetry is enabled by default for EE customers and can be disabled with
MASTRA_TELEMETRY_DISABLED=1; community users are unaffected. (#16660)Added new editor configuration primitives for browser providers, agent builder integration, and stored-agent visibility. (#16778)
New:
BrowserProviderinterfaceImplement a browser provider to expose browser automation tools to agents via the editor. Each provider declares an id, name, and config schema, then returns a
MastraBrowserinstance fromcreateBrowser.New:
MastraEditorConfig.browsersand.builderWire browser providers and agent-builder options into the editor:
New:
visibilityonupdateAgentMetaSet an agent's visibility (private or public) through the editor namespace:
publishSkillnow returns the full skill file tree so consumers can persist the UI-facing tree alongside storage blobs without re-walking the source. (#16666)Also added two optional capability methods to
IMastraEditorfor server-side gating of builder-aware behavior:Both methods are optional — existing implementations of
IMastraEditorcontinue to work unchanged. Servers that consume them treatundefined/ missing implementation as "no builder configured."Added route-specific CORS configuration so credentialed cross-origin access can be limited to selected custom routes and channel webhooks. (#16689)
Use
server.corsfor one global CORS policy across the server:Narrowed
AgentSignalContentsfromBaseMessageListInputtostring | (TextPart | FilePart)[]. (#16622)Fixed two signal-content bugs:
user-messagesignal attributes now reach the LLMuser-messagesignals no longer lose file partsCallers that previously passed wrapped message shapes to
agent.sendSignalshould now pass a bare string or a bare parts array.Before:
{ type: 'user-message', contents: [{ role: 'user', content: [{ type: 'text', text: 'hi' }] }] }After:
{ type: 'user-message', contents: [{ type: 'text', text: 'hi' }] }Added an optional
providerOptionsfield toagent.sendSignalthat flows through to the resulting prompt turn (asproviderOptionson the LLM message) and is persisted on the stored signal message (ascontent.providerMetadata).publishSkillFromSource()(andcollectSkillForPublish()) now return afilesfield containing the full skill source as a tree ofStorageSkillFileNodeentries with base64-encoded blob content — handy for storing a UI-facing copy of a skill alongside its content-addressable tree: (#16673)Existing callers that only destructure
{ snapshot, tree }are unaffected; the field is additive.Also adds
parseSkillSnapshotFromFiles()for parsing skill snapshot frontmatter from a flat file list (used by the registry install flow):Added delta polling support for observability list APIs in core, DuckDB, and ClickHouse. (#16632)
Patch Changes
Update provider registry and model documentation with latest models and providers (
452036a)Fixed task_update to auto-demote previously in_progress tasks instead of returning an error when moving another task to in_progress. (#16843)
Fixed durable agents to honor activeTools when streaming. (#16646)
Fixed type error when a tool calls
suspend(...)insideexecutewhile also declaring anoutputSchema. Theexecutereturn type now allowsvoidin addition to the declared output shape, so the idiomaticreturn await suspend(...)pattern type-checks correctly. (#16799)Fixed a startup bug in
MastraCompositeStore.init()when usingdefaultoreditor. (#16786)Before this fix, the composite initialized inner domains directly and could skip parent store initialization. That could skip adapter setup steps and cause missing-table errors during startup (most visibly with
LibSQLStoreon a local file).Now,
MastraCompositeStore.init()runs parentdefaultandeditorinitialization first, then initializes only domains not already covered by those parents. This preserves adapter-specific initialization behavior and prevents startup races.Fixes #16782.
Fixed CompositeAuth incorrectly advertising SSO, session, and user provider capabilities when no inner provider supports them. Studio would show an SSO login button even when no provider had SSO configured, leading to 401 errors on login attempts. The duck-typing check now verifies that interface methods are actual functions rather than just present on the prototype chain. (#16664)
Hide internal workflow spans from Mastra-owned plumbing in exported traces. (#16631)
Channels now serialize messages per thread to keep conversations in order, and the tool approval flow is fixed end-to-end: (#16517)
providerMetadata.mastra.channels.<platform>.declineToolCallinstead of leaving it suspended.agent.subscribeToThread()consumers also receive chunks from resumed runs (the subscription used to drop the second registration for a resumed run that kept its originalrunId).ChannelConfigis now exposed via the newAgentChannels.channelConfigfield so channel providers can merge with existing adapters instead of replacing them.chatto^4.29.0.Added the
internalUsage?: UsageStatsfield toAIBaseAttributes, so any span type can carry token usage rolled up from internal descendant spans. Populated automatically by@mastra/observabilitywhen an internalMODEL_GENERATIONends inside a non-internal ancestor. (#16434)Fixed trajectory scorers so tool calls stored only in V2 content.parts are included in extracted eval steps. (#15439)
Fixed thread metadata updates to merge with existing fields instead of replacing them. Previously, updating a thread's metadata would silently drop any fields not included in the update. Now existing metadata fields are preserved when updating. (#16846)
Fixed MockMemory working memory tool to support partial JSON updates when using schema-based working memory. Previously, sending a partial update would overwrite all existing data. Now for schema-based configs, unchanged fields are preserved automatically (matching @mastra/memory behavior).
Fixed MockMemory constructor to preserve workingMemory config options (like schema) when enableWorkingMemory is true.
Improved MastraCode quiet mode so terminal sessions are easier to scan. (#16771)
Remove hardcoded
/api/prefix check fromregisterApiRoute(). The check incorrectly rejected custom routes starting with/api/even when users configured a differentapiPrefix. Reserved-path validation is already handled at the server adapter level using the actual configured prefix. (#16859)Fixed infinite recursion in
RequestContext.toJSON()when multiple (#16686)RequestContextinstances reference each other through stored values.Previously, serializing such cross-context cycles would cause a CPU hang.
Cyclic references are now detected and omitted from the serialized output,
consistent with how circular references within a single context are handled.
Fixed crash in CacheKeyGenerator.fromAIV4Part when a tool-invocation part has undefined toolInvocation. This can happen when observational memory seals a partially-streamed assistant message. Also guarded MessageMerger against the same condition. (#16773)
Agent signals can now coordinate active thread runs across agents that share a PubSub instance, so thread subscribers and signal senders can observe the same run instead of being limited to one runtime instance. (#16665)
Exposed
formatSkillActivation(skill)from@mastra/core/workspace. It returns the activation payload — instructions plus references, scripts, and assets listings — that the built-inskilltool uses, so callers (e.g. an explicit/skill/<name>slash command) can produce the same output without duplicating the formatting logic. (#16618)Also preserves the
user-invocableskill frontmatter field in workspace skill metadata.Fixed sub-agent streams so nested tool input progress is emitted while tool arguments are still being generated. This lets UIs show delegated agents preparing tool calls before the final tool input is available. Fixes #16422. (#16553)
Fixed
backgroundTasks: { enabled: true }silently dispatching foreground-only tools to the background. (#16792)Previously, enabling
backgroundTaskson theMastrainstance injected a system prompt into every agent that taught the LLM to flip any tool to background by passing_background: { enabled: true }in its arguments, and the resolver honored that override unconditionally. Models would readily do this for short, deterministic tools — a plain calculator could return"Background task started…"instead of{ result: 42 }, breakingagent.generate()/agent.stream()for tool-using flows.The LLM
_backgroundoverride is now treated as a modifier on tools the developer has opted in at the tool or agent layer, not a standalone opt-in. If a tool hasn't been opted in via tool-levelbackground: { enabled: true }or agent-levelbackgroundTasks: { tools: { … } }(ortools: 'all'),_background.enabled: truefrom the model is ignored and the tool runs in the foreground. Opted-in tools continue to honor LLM overrides forenabled,timeoutMs, andmaxRetriesas documented.Fixes #16783
Fixed scheduler performance and correctness issues that could cause excessive Postgres CPU and noisy failed runs. (#16805)
(status, next_fire_at)onmastra_schedulesand(schedule_id, actual_fire_at)onmastra_schedule_triggers. Without these the scheduler performed a full sequential scan on every tick.scheduler.enabledis set explicitly), so deployments without scheduled workflows no longer poll the database at all.startWorkers(). Accessingmastra.schedulerbeforestartWorkers()runs throws a descriptive error instead of returning a half-initialized instance.Fixed Mastra getting stuck after a storage startup failure. Previously, if storage couldn't start up (for example, because the database was briefly unreachable), Mastra would keep returning the same error for every operation until the process was restarted. Now the next storage operation tries to start storage again, so brief outages recover on their own. Storage startup failures are also logged, so the problem is visible even when a later retry succeeds. (#16427)
Restore MastraCode local command execution to inherit parent environment variables while redacting env-shaped and secret-looking workspace trace data. (#16691)
Added a Unix socket PubSub transport and wired the Mastra Code TUI through a per-resource socket so local sessions can coordinate thread streams across processes. Programmatic
createMastraCodeusage remains opt-in: (#16669)Fix in-memory observability storage to match the contract validated against DuckDB/ClickHouse vNext adapters. (#16808)
Previously, when running Mastra with the default in-memory storage, several observability operations behaved differently than they would against a production database:
getSpansthrew 'This storage provider does not support batch-fetching spans'. It now batch-fetches spans by id within a trace, enabling the optimizedgetBranchpath on in-memory storage.batchCreateLogs,batchCreateMetrics,createScore/batchCreateScores,createFeedback/batchCreateFeedbackappended duplicate records on retry. They now upsert by id, preserving the cursor id so delta polling does not re-emit the record. This makes client retries safe.getEntityTypes,getEntityNames,getServiceNames,getEnvironments,getTags) only inspected spans. They now also scan logs and metrics, so dimensions emitted on those surfaces are surfaced in discovery results.getMetricTimeSeriesmerged grouped series whose label values contained the|character (e.g.{segmentA: 'a', segmentB: 'b|c'}collided with{segmentA: 'a|b', segmentB: 'c'}). Series are now keyed on the original label tuple, so colliding display names remain distinct series.v1.35.0Compare Source
Minor Changes
Added FGA route policy coverage controls, built-in resource route metadata resolution, and resolver hooks. (#16485)
For example:
Added a favorites storage domain that lets users mark stored agents and skills as favorites, plus
visibility('private' | 'public') andfavoriteCountfields on stored agents and skills so callers can list, filter, and order by favorite state. (#16580)Existing rows without
visibilityorfavoriteCountcontinue to work; the new fields and APIs are opt-in.Example
Patch Changes
Update provider registry and model documentation with latest models and providers (
b661349)Fixed a workspace PATCH bug in the inmemory workspace adapter: omitted config fields in a PATCH no longer overwrite previously-persisted values with
undefined. (#16580)Fixed active signals so they stay in the correct order when conversations are reloaded from memory. (#16623)
Fixed scheduled workflows created from the public @mastra/core/workflows entry point so declared schedules are applied correctly. (#16637)
Fixed a crash when importing
@mastra/core/workflows/workflowfrom tests or apps, which previously failed withTypeError: Class extends value undefined is not a constructor or null(caused by a circular ESM import through theworkflowsbarrel). (#16661)v1.34.0Compare Source
Minor Changes
You can now run ACP-compatible coding agents as Mastra tools or lightweight subagents. ACP agents support incremental response streaming and can be used anywhere Mastra accepts a
SubAgent, including supervisor delegation and workflow steps. (#16423)You can also wire an
AcpAgentinto a supervisor or workflow as aSubAgent-compatible implementation:Workflows and the Inngest workflow adapter now recognize
SubAgent-compatible implementations when creating agent-backed workflow steps.Added optional
metadatato code-defined agents. Pass ametadatarecord tonew Agent({...}), read it back withagent.getMetadata(), and clients can filter on it from the existing/agentsand/agents/:agentIdresponses without encoding the data into IDs or names. (#16603)Metadata supports the same
DynamicArgumentform as other agent config fields, so it can also be resolved per request from the request context.Stored agents loaded via the editor also expose their metadata through
agent.getMetadata(), so clients can filter these agents as well. Cloning a runtime agent viaeditor.agent.clone()now carries the source agent's metadata over to the stored clone when the caller does not provide one explicitly.Added an opt-in foundation for building agent-builder admin policies and role-aware capabilities, available under two new entry points. (#16578)
@mastra/core/agent-builder/eeExposes types, validators, and picker utilities for working with model allowlists and admin model policies on stored agents — for example normalizing model candidates, choosing a default from a configured allowlist, and producing typed errors when a request violates policy.
@mastra/core/auth/eeAdds optional methods on
IRBACProviderfor listing available roles and resolving the permissions for a given role:Static defaults, an expanded permissions catalog, and a capabilities helper that surfaces
availableRolesto clients when the provider supports it are also included. Providers that do not implement the new methods continue to work unchanged.Also adds a
StorageBrowserRefshape to@mastra/core/storagefor referencing a configured headless browser on stored agents.Improved how the workspace
read_filetool returns files to the model. Reads now branch on file type: (#16570)image/png,image/jpeg,image/webp,application/pdf) are surfaced as native file/image parts the model can directly view, instead of being dumped as base64 text. Capped at 10 MiB by default so large media don't get base64-encoded into context and persisted in storage — configurable viamaxMediaBytes.text/*, common code/config mime types, or unknown extensions) are returned as text content as before.image/pngwhenmediaTypesis disabled,application/zip, oversized media, etc.) now return a short metadata description (path, size, mime type) instead of dumping useless base64 into the conversation. Pass an explicitencodingto opt back into the raw base64/hex dump.The set of mime types treated as native media parts and the inline size cap are configurable per workspace:
The default
mediaTypesis intentionally the cross-provider-safe intersection — formats universally supported across Anthropic, OpenAI, and Gemini.Changed background process output retention. (#16574)
Before: Spawned process handles retained all stdout and stderr, which could grow without bound for long-running background processes.
After: Spawned process handles now retain the latest 1 MiB of stdout and stderr per stream by default. Pass
maxRetainedBytestoprocesses.spawn()to customize the limit, use0to disable retained polling output, or useInfinityto keep the previous retain-all behavior.Streaming callbacks and reader streams still receive every chunk in full. Handles also expose truncation and dropped-byte counters so callers can detect when
stdout,stderr, orwait()results only include retained output.The built-in
executeCommand()implementation still retains full output by default; passmaxRetainedBytesthere only when you want bounded command results.Patch Changes
Update provider registry and model documentation with latest models and providers (
784ad98)Improved background-task observability. (#16590)
Retry attempts now appear as separate workflow steps in run history and event traces, making retry progression easier to debug. No public API changes.
Fixed approval resume for tools loaded by processor workflows. (#16365)
Fixed durable agents that could drop object-form system instructions when provider options like
cacheControlwere used. These instructions are now preserved so provider-specific options are respected. (#16599)Fixed approval resume for tools loaded with ToolSearchProcessor. (#16365)
Fixed listMessages perPage=0 behavior in the in-memory store to match other adapters. (#16602)
Fixed non-deterministic ordering of cross-thread semantic recall messages. (#16600)
When messages recalled from other threads shared the same timestamp, they were rendered into the system prompt in whatever order the vector query returned them — driven by similarity scores that can vary between equivalent runs. This made any test or evaluation that snapshots prompt output (or hashes the outbound LLM request) flaky.
Recalled cross-thread messages are now sorted by createdAt, then threadId, then role (user → assistant → tool → system), then id before formatting, so the same set of recalled messages always produces the same prompt.
Expose
GET /observability/traces/lightand storage support for fetching paginated trace-list rows without span payload data. (#16608)GET /api/observability/discovery/metric-namesandGET /api/observability/discovery/metric-label-valuesnow acceptlimitas a URL query parameter without pre-parsing. Previously, passing?limit=10was rejected as a validation error; callers can now use these endpoints directly from HTTP clients, consistent with other query endpoints (e.g. pagination). (#16489)Fixed agent signals so standalone agents coordinate thread streams through a shared runtime. (#16581)
v1.33.1Compare Source
Patch Changes
Update provider registry and model documentation with latest models and providers (
6ba46dc)Fixed a bug where clicking Approve on a plan from
/planmode would show the system reminder twice and sometimes hang instead of starting build execution. Approving now reliably triggers the build agent with a single reminder. (#16521)Added (#16520)
You can now call
run.restart()for evented workflows to continue execution from the latest persisted run state.v1.33.0Compare Source
Minor Changes
Added
processLLMRequest, a processor hook that runs after messages are converted to the provider-facing prompt and before the model request is sent. The hook lets processors make temporary, model-aware prompt changes without mutating stored message history, memory, UI history, or later provider calls. (#16176)ProviderHistoryCompatnow uses this hook to prevent reasoning-history incompatibilities when switching providers. It strips reasoning parts from Cerebras-bound prompts that would otherwise be sent as rejectedreasoning_content, and strips non-Anthropic reasoning from Anthropic-bound prompts while preserving Anthropic-native thinking blocks.Improved Harness support for Agent thread signals. (#16231)
Harness thread subscriptions now own stream processing for followed runs, echo user-message signal data with stable IDs, and support idle signal starts without delaying optimistic rendering.
Added target-aware tool payload transforms for display streams and transcript messages. Tool authors can transform tool input, output, errors, approval payloads, and suspension payloads without changing raw runtime behavior or toModelOutput. See #16054. (#16103)
Use
transformon tools, agents, Mastra, or individual generation calls to configure these payload transforms. Runtime callers using the previoustoolPayloadProjectionshape continue to be normalized for compatibility.Added Azure OpenAI Responses API and v1 routing controls. (#16246)
Use
useResponsesAPI: trueto resolve Azure deployments through the Responses API with the Azure v1 route by default:When
useDeploymentBasedUrls: falseis used directly, the gateway now defaultsapiVersionto"v1"to match the AI SDK Azure provider's v1 URL route. PassingapiVersion: "v1"by itself keeps the existing deployment-based URL default for compatibility.Mastra Eval results are now emitted once through the unified observability score pipeline. (#16185)
Added Azure OpenAI Responses WebSocket transport support for streaming agent and tool loops. (#16246)
Configure the Azure gateway with
useResponsesAPI: true, then opt into WebSocket streaming per request:Responses WebSocket streams now preserve transport handles through agent loops, reuse explicit API-key router connections safely, clean up cancelled streams, and reject overlapping
previous_response_idcontinuations on the same connection.Added
preserveModelOutputtoToolCallFilterso filtered tool history can keep compact model-facing output without raw tool args or results. (#16060)Added a SubAgent interface for custom supervisor subagents. (#16359)
Added
ResponseCacheinput processor (#16283)Cache identical LLM steps to skip the model call and replay a previously cached response. Useful for prompt templates, suggested-prompt buttons, agentic search re-asks, or guardrail LLMs that classify the same input over and over.
Caching is opt-in: register
ResponseCacheexplicitly oninputProcessors. There is no agent-level option — this keeps the surface small while we collect feedback on the processor API. Per-call overrides flow throughRequestContext.Per-call overrides via
RequestContext:Three fields are overridable per call:
key,scope,bust.cache,ttl, andagentIdstay on the constructor.A
keyfunction receives{ agentId, scope, model, prompt, stepNumber }and returns a string (orPromise<string>):The cache key is derived from the resolved prompt Mastra is about to send to the model — i.e. after memory loading and earlier input processors have run — so cached entries are tenant-isolated and don't leak context across users with shared prompts but different memory state. Each step in an agentic tool loop is independently cached. By default, the cache scope falls back to
MASTRA_RESOURCE_ID_KEYfrom the request context for automatic per-user isolation. Failed runs (errors, tripwire activations) are not cached. See Response caching for details.Also adds:
InMemoryServerCache(in@mastra/core/cache) for local development.ResponseCacheaccepts anyMastraServerCachedirectly — useRedisCachefrom@mastra/redisfor production.MastraServerCache.set()now accepts an optionalttlMsargument so implementations can override the configured default TTL on a per-entry basis.InMemoryServerCacheandRedisCache(in@mastra/redis) both honor this.processLLMRequestandprocessLLMResponse.ProcessLLMRequestResultmay return{ response }to short-circuit the LLM call with a cached payload.Added workflow state reader helpers to inspect persisted workflow runs and recover suspended or long-running workflows. (#16091)
The reader exposes suspended steps, resume labels, step payloads, and step outputs from the public WorkflowState returned by workflow.getWorkflowRunById(), and WorkflowState step results now reflect foreach array entries.
Added Agent signals for sending contextual messages into agent thread loops and subscribing to thread activity. (#16229)
Call
agent.sendSignal()to inject context into a running agent loop. When the thread is idle, that same signal becomes the prompt that starts the next loop by default. UseifActive.behaviorandifIdle.behaviorto deliver, persist, discard, or wake from a signal.Use
agent.subscribeToThread()to follow the raw stream chunks for a memory thread, observe signal echoes with stable IDs, and abort the active stream for that thread.Add metadata filtering support to semantic recall. (#9256)
Fixed Azure and OpenAI Responses item handling so multi-step reasoning and tool-call histories round-trip correctly without item ID collisions. (#16246)
Added provider-neutral response item helpers to
@mastra/core/agent/message-list. Existing in-memory message cache entries are regenerated after upgrade.Improved foreach workflow execution to keep concurrency slots filled as iterations finish. (#12860)
Added processor
sendSignalsupport and routed built-in system reminders through signal messages. (#16438)Added structured drop event types and an
onDroppedEventhook so exporters and bridge integrations can observe events dropped by the observability pipeline. (#16111)Added stable IDs to Harness task items plus
task_updateandtask_completefor updating or completing one tracked task by ID. Task tools now return structured task snapshots, andtask_checkreturnssummaryandincompleteTasksfields so agents and UIs can restore and verify task state without parsing text. (#16254)Harness also exports
TaskItemSnapshot,assignTaskIds, andharness.restoreDisplayTasks()for UI history replay, serializes task reads and mutations against the latest task state snapshot, and returns task-tool errors inside forked subagents so sidecar work cannot mutate parent task state.Added new
MODEL_INFERENCEspan type underMODEL_STEP, covering only the model provider call. Use it to measure model latency separately from input/output processors and tool executions. (#16267)Added experimental support for using remote A2A agents as Mastra subagents. (#16348)
What changed
A2AAgentand delegate to them like other subagents.generate,resumeGenerate,stream, andresumeStreamso parent agents can use them in normal subagent flows.@mastra/core/a2a/client.Example
Why
This lets Mastra agents compose with remote A2A agents without exposing those integrations as plain tools or depending directly on the client SDK.
Worker review fixes: (#16309)
POST /workflows/:id/runs/:runId/steps/execute) isnow gated by Mastra's standard
requiresAuth: true+authenticateTokenpipeline rather than a parallel "worker secret" body field. The previously
introduced
workerSecretconfig knob andMASTRA_WORKER_SECRETenv varhave been removed (they were never released). To gate the endpoint on a
standalone-worker deployment, configure an auth provider on the server's
Mastrainstance — without one the framework currently treatsrequiresAuth: trueas a no-op for this route.HttpRemoteStrategynow sends credentials as a normalAuthorization: Bearer <token>header. The token comes from the newMASTRA_WORKER_AUTH_TOKENenv var or an explicitauthconstructor option.abortSignalinHttpRemoteStrategyby combining itwith the per-request timeout via
AbortSignal.any(with a manual fallbackfor runtimes that don't expose it).
MASTRA_WORKERSenv var.MASTRA_WORKERS=scheduler,backgroundTasksnow boots only those namedworkers;
MASTRA_WORKERS=falsestill disables all workers.Mastra.startEventEngine/stopEventEngineas@deprecatedaliases for the renamed
startWorkers/stopWorkers.BackgroundTaskWorkernow subscribes to PubSub instart()instead ofinit(), matching the lifecycle of the other workers and makingisRunningaccurately reflect subscription state.RedisStreamsPubSubadds amaxDeliveryAttemptsoption (default 5) thatdrops events after the configured number of failed deliveries instead of
redelivering forever, and replaces empty
catch {}blocks withlogger.warn/logger.debugcalls.RedisStreamsPubSub.unsubscribe(topic, cb)now honors the topic argumentso the same callback can be subscribed to multiple topics independently.
PullTransportguards the async router callback against unhandled promiserejections by attaching a
.catchthat nacks the message.MASTRA_WORKER_NAMEenv var injection in the CLI workerspawn (the bundle entrypoint already passes the worker name directly).
(
pubsub/redis-streams/src/auth-e2e.test.ts) covering happy path, wrongtoken, missing token, anonymous direct hits, and the no-auth-provider
pin-down behavior.
schema-consistency.test.ts.as anycasts in worker strategiesand
BackgroundTaskWorker).RedisStreamsPubSub.maxDeliveryAttemptsnow rejects negative / NaN valuesat construction.
0still means "no cap" for back-compat but emits aone-time warning; pass
Infinityto disable the cap explicitly.PullTransportaccepts a logger and uses it for unhandled router-callbackrejections instead of
console.error.BackgroundTaskWorker.start()now throws ifinit()was not called,matching the contract of the other workers.
(
test-fixtures/cli-project/src/mastra/index.ts) through two genericentries that mirror what
BuildBundlerandWorkerBundleremit. Theprevious one-off
server.entry.ts/worker.entry.ts/scheduler.entry.ts/background.entry.tsfiles have been deleted —they implied users hand-roll entry files, which they don't. Worker role
is selected via
MASTRA_WORKERSexactly as in production.Push-capable PubSub:
PubSubabstract class now declares asupportedModesgetter(defaulting to
['pull']for backward compatibility) so consumers cantell whether a broker delivers events through a pull loop, an in-process
push, or an out-of-process HTTP push.
EventEmitterPubSubreports['pull', 'push'](EventEmitter dispatches synchronously and works foreither path),
@mastra/redis-streamsreports['pull'].Mastranow exposes a publichandleWorkflowEvent(event)method backedby a shared
WorkflowEventProcessor. It is the single entry point usedby the existing pull-mode
OrchestrationWorker, by in-process pushpubsubs (auto-wired during
startWorkers()), and by the newPOST /api/workflows/eventsroute which lets push-mode brokers (GCPPub/Sub push, SNS, EventBridge) deliver events over HTTP.
'pull', Mastraautomatically skips creating an
OrchestrationWorkerandOrchestrationWorker.init()throws a clear error if it is constructedagainst a push-only pubsub.
WorkflowEventProcessorgains ahandle(event)method that returns astructured
{ ok, retry }result. The originalprocess(event, ack?)method is preserved as a thin wrapper for back-compat.
Public-API example for a push-capable PubSub:
CI follow-ups:
Mastraonly auto-registersSchedulerWorkerwhen storage is configured.Without storage the worker would crash on startup (
deps.storage.getStoreon undefined); the scheduler now silently no-ops in that case, matching the
pre-worker scheduler behavior.
SchedulerWorker.initdefensively logs and returns when called withoutstorage instead of throwing a TypeError.
RECEIVE_WORKFLOW_EVENT_ROUTE(`POSTConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.